package com.dynamic.manager.controller.admin.job;

import com.dynamic.model.service.RequestServiceI;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.LinkedHashMap;
import java.util.Map;


@Controller
@RequestMapping(value="/admin/job")
public class JobController {
	private static final Logger LOGGER = Logger.getLogger(JobController.class);

	@Autowired
	private RequestServiceI requestServiceI;

	@RequestMapping(value = "tojoblist")
	@ResponseBody
	public ModelAndView tocodelist() {
		ModelAndView mav = new ModelAndView();
		Map<String,String> nav=new LinkedHashMap<String,String>();
		nav.put("后台","#");
		nav.put("任务管理","#");
		nav.put("任务列表","/admin/job/tojoblist");
		mav.addObject("navmap", nav);
		mav.setViewName("jsp/index");
		return mav;
	}

	@RequestMapping(value = "flushCache")
	@ResponseBody
	public void flushCache() {
		requestServiceI.flushCache();
	}
}

